﻿using System;
using System.Collections.Generic;

namespace NanoMvvm.Collections
{
    public class DelegateComparer<T> : IComparer<T>
    {
        private readonly Func<T, T, int> handler;

        public DelegateComparer(Func<T, T, int> handler)
        {
            this.handler = handler;
        }

        public int Compare(T x, T y)
        {
            return handler(x, y);
        }
    }
}